﻿using System.Xml.Serialization;
using TeaLight.Core.DAL;
using TeaLight.DL.SQLite;

namespace TeaLight.Core.BL.Entities
{
    public partial class SessionSpeaker : BusinessEntityBase
    {

        #region Constructor

        public SessionSpeaker()
        {
        }

        public SessionSpeaker(int sessionId, int speakerId)
        {
            SessionId = sessionId;
            SpeakerId = speakerId;
        }

        #endregion

        #region Fields


        [XmlElement("s1")]
        public int SessionId { get; set; }

        [XmlElement("s2")]
        public int SpeakerId { get; set; }

        #endregion

        #region Associations

        [XmlIgnore]
        [TeaLight.DL.SQLite.Ignore]
        public Session Session
        {
            get
            {
                return SessionSpeakerRepository.GetSession(this);
            }
        }

        [XmlIgnore]
        [TeaLight.DL.SQLite.Ignore]
        public Speaker Speaker
        {
            get
            {
                return SessionSpeakerRepository.GetSpeaker(this);
            }
        }

        #endregion

    }

}
